<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            *{
                margin: 0px;
                padding:0px;
                list-style: none;
            }
            header{
                height: 100px;
                width: 963px;
                margin: 0 auto;
            }
            .logo{
                float: left;
                height: 40px;
                width: 300px;
            }
            .logo img{
                width: 300px;
                padding: 0px 10px;
            }
            .search{
                width: 640px;
                height: 39px;
                background: goldenrod;
                margin:60px auto 10px;
                position: relative;
                float: right;
            }
            .search input{
                float: left;
                width: 539px;
                height: 37px;
                border:1px solid goldenrod;
                border-right: none;
                outline: none;
                font-size: 20px;
                padding-left: 5px;
            }
            .search button{
                float: right;
                width: 95px;
                height: 39px;
                background: goldenrod;
                border: 1px solid goldenrod;
                outline: none; 
            }
            .search span{
                position: absolute;
                left: 510px;
                top:11px;
                width: 17px;
                height: 16px;
            }
            nav{
                height: 50px;
                width: 963px;
                margin: 20px auto;
                background: goldenrod;
            }
            nav ul{
                width: 963px; 
                height: 50px;
                margin:0px auto；
            }
            nav li{
                float:left;
                color:white;
                margin: 10px 40px;
                font-size: 20px;
                font-family: '幼圆'
            }
            main{
                height:355px;
                width: 963px;
                margin: 25px auto;
                background: goldenrod;
            }
            main #wrap{
                width: 600px;
                height: 350px;
                margin:0px auto;
                position: relative;
                overflow: hidden;
                float: left;
            }
            main #wrap img{
                width: 600px;
                height: 350px;
            }
            main #wrap  ul{
                width: 9999px;
                position: relative;
                left:0px
            }
            main #wrap ul li{
                float: left;
            }
            main #wrap ol{
                position: absolute;
                bottom:0px;
                left:50%;
               transform: translateX(-50%);
            }
            main #wrap ol li{
                margin:0px 4px;
                width:10px;
                height: 10px;
                border-radius: 50%;
                background:white;
                float: left; 
                cursor: pointer;
            }
            main #wrap span{
                position: absolute;
                top:50%;
                transform: translateY(-50%);
                background:skyblue;
                cursor: pointer;
            }
            .left{
                left:10px
            }
            .right{
                right: 10px;
            }
            #wrap .current{
                background: skyblue;
            }
            .landing {
                height: 350px;
                width: 323px;
                margin: 0 20px;
                float: right;
            }
            .landing ul{
                overflow: hidden;
            }
            .landing ul li{
                float: left;
                width: 160px;
                height: 30px;
                margin-right: 0px;
                text-align: center;
            }
            .landing input{
                width: 250px;
                height: 37px;
                border:1px solid goldenrod;
                border-right: none;
                outline: none;
                font-size: 16px;
                padding-left: 5px;
            }
            .landing ul li:nth-of-type(1){
                background:gray;
            }
            .landing section>div{
                height: 350px;
                width: 300px;
                text-align: center;
                display: none;
                display: none;
                margin: 18px 8px;
            }
            .landing img{
                height: 200px;
                width: 200px;
            }
            .landing section>div:nth-of-type(1){
                display: block;
            }
            footer{
                height: 600px;
                width: 1000px;
                margin: 0 auto;
                background: salmon;
            }
            footer li{
                float: left;
                margin: 10px 10px;
                width: 230px;
                height:280px;
                background: cadetblue;
            }
        </style>
    </head>
    <body>
        <header>
            <div class="logo">
                <img src="images/logo.png" alt="">
            </div>
            <div class="search">
                <input type="text" placeholder="宝，想吃啥">
                <button>搜索</button>
                <span></span>
            </div>
        </header>
        <nav>
            <ul>
                <li><a href="">汉堡披萨</a></li>
                <li>龙虾烧烤</li>
                <li>奶茶饮品</li>
                <li>快餐小吃</li>
                <li>家常便饭</li>
                <li>异国风味</li>
            </ul>
        </nav>
        <main>
            <div id="wrap">
                <ul id="box">
                    <li><img src="images/pic1.jpg" alt=""></li>
                    <li><img src="images/pic2.jpg" alt=""></li>
                    <li><img src="images/pic3.jpg" alt=""></li>
                    <li><img src="images/pic4.jpg" alt=""></li>
                </ul>
                <ol id="list">
                    <li class="current"></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ol>
                <span class="left" id="left"><</span>
                <span class="right" id="right">></span>
            </div>
            <script>
                var num=0;
                var box=document.getElementById('box');
                var wrap=document.getElementById('wrap');
                var left=document.getElementById('left');
                var right=document.getElementById('right');
                var list=document.getElementById('list').children;
                var timer;
                function fn(){
                    timer=setInterval(function(){
                        num--;
                        if(num<-3){
                            num=0
                        }
                        for(var i=0;i<list.length;i++){
                            list[i].className='';
                        }
                        list[-num].className='current';
                        box.style.left=600*num+'px';

                    },1000)
                }
                fn()
                wrap.onmouseenter=function(){
                    clearInterval(timer)
                }
                wrap.onmouseleave=function(){
                    fn()
                }
                for(var i=0;i<list.length;i++){
                    list[i].index=i;
                    list[i].onclick=function(){
                        for(var n=0;n<list.length;n++){
                            list[n].className=''
                        }
                        this.className='current';
                        var m=this.index;
                        num=-m;
                        box.style.left=600*num+'px';

                    }
                }
                right.onclick=function(){
                        num--;
                        if(num<-3){
                            num=0
                        }
                        for(var i=0;i<list.length;i++){
                            list[i].className='';
                        }
                        list[-num].className='current';
                        box.style.left=600*num+'px'; 
                }
                left.onclick=function(){
                        num++;
                        if(num>0){
                            num=-3
                        }
                        for(var i=0;i<list.length;i++){
                            list[i].className='';
                        }
                        list[-num].className='current';
                        box.style.left=520*num+'px'; 
                }
            </script>
            <div class="landing">
                <ul id="login">
                    <li>扫码登录</li>
                    <li>账户登录</li>
                </ul>
                <section id="box1">
                    <div>
                        <img src="images/pic5.jpg" alt="">
                        <br><br>
                        <a href="">还没有账号？点我立即注册</a>
                    </div>
                    <div>
                        <p>用户名</p>
                        <input type="text" placeholder="用户id/手机号">
                        <br><br>
                        <p>密码</p>
                        <input type="text">
                        <br><br>
                        <a href="">还没有账号？点我立即注册</a>
                    </div>
                </section>
                <script>
                    var tags=login.children;
                    var boxs=box1.children;
                    for(var i=0;i<tags.length;i++){
                        tags[i].index=i;
                        tags[i].onclick=function(){
                            for(var j=0;j<tags.length;j++){
                                tags[j].style.background="none";
                                boxs[j].style.display="none"
                            }
                            this.style.background='gray';
                            var n=this.index;
                            boxs[n].style.display='block'
                        }
                    }
                </script>
            </div>
        </main>
        <footer>
            <ul>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </footer>
        <div class="partner">

        </div>
    </body>
</html>